package com.zrspring.libv2.util.security;


import android.content.Context;
//import com.facebook.android.crypto.keychain.AndroidConceal;
//import com.facebook.android.crypto.keychain.SharedPrefsBackedKeyChain;
//import com.facebook.crypto.Crypto;
//import com.facebook.crypto.CryptoConfig;
//import com.facebook.crypto.Entity;
//import com.facebook.crypto.exception.CryptoInitializationException;
//import com.facebook.crypto.exception.KeyChainException;
//import com.facebook.crypto.keychain.KeyChain;
//import com.zrspring.lib.util.LogUtil;
//
//import java.io.IOException;
//import java.nio.charset.Charset;

/**
 * Version: 1.0
 * Author: rui
 * CreatDate: 2016年05月20日23:43 43
 * Encoding:UTF-8
 * Description: 字符串加密工具
 */
public class ConcealUtils {


    public void AA(Context context,String pwd) {
//
//        KeyChain keyChain = new SharedPrefsBackedKeyChain(context, CryptoConfig.KEY_256);
//        Crypto crypto = AndroidConceal.get().createDefaultCrypto(keyChain);
//        String password = "ct9898988";
//        Entity entity = new Entity("wofuck");
//        byte[] passwordBytes = password.getBytes(Charset.forName("UTF-8"));
//        byte[] encryptedPass;
//        try {
//            encryptedPass = crypto.encrypt(passwordBytes, entity);
//
//            LogUtil.infoMessage("ConcealUtils","encryptedPass = " +encryptedPass);
//            LogUtil.infoMessage("ConcealUtils","encryptedPass = " +encryptedPass.toString());
//
//            byte[] decryptedPass = crypto.decrypt(encryptedPass, entity);
//
//            LogUtil.infoMessage("ConcealUtils","========================================== ");
//            LogUtil.infoMessage("ConcealUtils","decryptedPass = " +decryptedPass);
//            LogUtil.infoMessage("ConcealUtils","decryptedPass = " +decryptedPass.toString());
//
//
//        } catch (KeyChainException e) {
//            e.printStackTrace();
//        } catch (CryptoInitializationException e) {
//            e.printStackTrace();
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//

    }
}
